Improve theme integration#693
Conversation
|
Hi, I tried this with our docs that use |
|
This PR is just for preventing MyST-nb from messing up a theme’s table CSS. I re-titled #618 to be more clear. For E.g. sphinx-book-theme currently does html[data-theme="dark"] .bd-content div.cell_output .text_html:not(:has(table.dataframe)),
html[data-theme="dark"] .bd-content div.cell_output .widget-subarea,
html[data-theme="dark"] .bd-content div.cell_output img {
background-color: var(--some-light-color);
}It would have to remove the second selector ( But this PR is a very necessary pre-condition for anything to be able to work. MyST just injecting this CSS is really bad and needs to be fixed! |
|
@bsipocz is there any recorded reason why that CSS exists? If yes, we need to fix this in another way. If not, we should really remove this without replacement, just setting styles for |
|
@bsipocz OK, so no reason not to merge this now, right? |
no reason just the lack of time. don't have JB1 using repos any more, so it would help review to have before/after screenshot for these types of changes. |
|
I totally get that! We all have limited time and it can be hard. Regarding previewing changesThe Regarding the visual changes this PR causedThe effect is that the padding is reduced, but as said, it makes no sense that some of the table styling
if you want e.g. increase the padding of the pydata theme, that should happen in sphinx-book-theme and not in this extension, and should use similarly specific CSS selectors to affect the same tables, not all tables. the other visual changes caused by this PR is simply that this extension’s dark mode support is now better. it now supports themes that set |
Fixes #618